<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title><?php echo html::specialchars($title) ?></title>

        <script type="text/JavasScript">
            onLoadFunctions = new Array();
            onUnloadFunctions = new Array();

            function registerOnLoadFunction(functionName)
            {
                onLoadFunctions.push(functionName);
            }

            function registerOnUnloadFunction(functionName)
            {
                onUnloadFunctions.push(functionName);
            }

            function callRegisteredLoadFunctions()
            {
                for (functionName in onLoadFunctions)
                {
                    functionName();
                }
            }

            function callRegisteredUnloadFunctions()
            {
                for (functionName in onUnloadFunctions)
                {
                    functionName();
                }
            }
        </script>

        <?php foreach ($registeredScripts as $scriptName): ?>
            <script type="text/JavaScript" src="<?php echo $ScriptName; ?>"></script>
        <?php endforeach; ?>

        <style type="text/css">
            <?php foreach ($registerStyles as $styleName): ?>
                @import url("<?php echo styleName; ?>")
            <?php endforeach; ?>
        </style>

    </head>
    <body onLoad="callRegisteredLoadFunctions();" onUnload="callRegisteredUnloadFunctions();">

        <?php echo $content ?>

        <!-- Rendered in {execution_time} seconds, using {memory_usage} of memory -->
    </body>
</html>